const home = {
  state: {
    cityName: '定位中..',
    location: '' // 位置定位
  },
  mutations: {
    SET_LOCATION: (state, location) => {
      state.location = location;
      wx.setStorageSync('location', location);
      state.cityName = location.addressComponent.city;
      wx.setStorageSync('cityName', location.addressComponent.city);
    },
    SET_CITY_NAME: (state, cityName) => {
      state.cityName = cityName;
      wx.setStorageSync('cityName', cityName);
    }
  },
  actions: {
  }
};

export default home
